package api

import (
	utils "hft/Http/Utils"
	"hft/tools/weixin/model"

	"github.com/gin-gonic/gin"
)

type Receive struct{}

func (*Receive) SwitchReceive(c *gin.Context) {

	switch c.Request.Method {
	case "GET":
		WeiXinCheck.CheckToken(c)
	case "POST":

		var data model.Subscribe

		c.ShouldBindXML(&data)

		WeiXinSubscribe.GetSub(&data)

		utils.Ok(c)
	default:
		utils.Fail(c)
	}

}

var WeiXinReceive = new(Receive)
